/*
 * @Author: your name
 * @Date: 2022-04-07 13:33:03
 * @LastEditTime: 2022-04-07 13:41:17
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: /comic-algorithm/chapter05/5.5.js
 */
/**
|--------------------------------------------------
| 判断是否是2的整数次幂  比如 16 是 2 的4次方  18就不是2的几次方 返回false
|--------------------------------------------------
*/
function isPowerOf2(num) {
  return num > 0 && (num & (num - 1)) === 0;
}
